package com.lagou.seckill.mvc.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("page")
public class PageController {

    @GetMapping("order/{commodityId}")
    public String order(Model model, @PathVariable String commodityId) {
        model.addAttribute("commodityId", commodityId);
        return "order";
    }

    @GetMapping("pay/{commodityId}")
    public String pay(Model model, @PathVariable String commodityId) {
        model.addAttribute("commodityId", commodityId);
        return "pay";
    }

}
